package com.example.medispider.service.listener;

import org.springframework.stereotype.Service;
import us.codecraft.webmagic.Request;
import us.codecraft.webmagic.SpiderListener;

@Service
public class MediSpiderListener implements SpiderListener {
    @Override
    public void onSuccess(Request request) {
        System.out.println("请求成功 ——>url：" + request.getUrl() + " ——>请求体：" + new String(request.getRequestBody().getBody()));
    }

    @Override
    public void onError(Request request, Exception e) {
        SpiderListener.super.onError(request, e);
    }
}
